<?php
namespace app\model;

use think\Model;

class Article extends Model
{
    protected $table = 'so_article';
    protected $autoWriteTimestamp = true;

    # 最新发布
    public static function getRecent ($where)
    {
        return self::where('state',3)->withoutField('test_html, test_content')->order('update_time desc')->page($where['page'], $where['limit'])->select()->toArray();
    }

    # 今日推荐
    public static function getRecommend ()
    {
        return self::where('status', 1)->order('rel_order desc')->select()->toArray();
    }

    # 热门文章
    public static function getHot ()
    {
        return self::where('state',3)->order('browse desc')->limit(5)->select()->toArray();
    }

}
